package io.chenglicun.modules.clc.service.impl;

import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.chenglicun.common.service.impl.CrudServiceImpl;
import io.chenglicun.common.constant.Constant;
import io.chenglicun.modules.clc.dao.ClcEventReleaseDao;
import io.chenglicun.modules.clc.dto.ClcEventReleaseDTO;
import io.chenglicun.modules.clc.entity.ClcEventReleaseEntity;
import io.chenglicun.modules.clc.service.ClcEventReleaseService;
import io.chenglicun.modules.security.user.SecurityUser;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * 活动发布
 *
 * @author HB 137664951@qq.com
 * @since 1.0 2023-11-24
 */
@Service
public class ClcEventReleaseServiceImpl extends CrudServiceImpl<ClcEventReleaseDao, ClcEventReleaseEntity, ClcEventReleaseDTO> implements ClcEventReleaseService {

    @Override
    public QueryWrapper<ClcEventReleaseEntity> getWrapper(Map<String, Object> params){
        QueryWrapper<ClcEventReleaseEntity> wrapper = new QueryWrapper<>();

        Object obj = params.get("isDefault");
        wrapper.eq(ObjectUtil.isNotEmpty(obj), "is_default", obj);


        return wrapper;
    }


}